package com.example.shop.merchant.enums;

public enum MerchantState {
    /**
     * 用户离线
     */
    offline(0),
    /**
     * 用户在线
     */
    online(1);
    byte state;
    MerchantState(int state){
        this.state = (byte) state;
    }
    public static MerchantState getMerchantState(byte state){
        for (MerchantState t:MerchantState.values()){
            if(t.state == state){
                return t;
            }
        }
        return null;
    }
    public static MerchantState getUserState(String name){
        return MerchantState.valueOf(name);
    }
    public byte getState(){
        return state;
    }
}
